package com.ydgk.dao;

import com.ydgk.bean.Login;
import com.ydgk.bean.User;
import org.springframework.jdbc.core.BeanPropertyRowMapper;

import java.util.List;

public class LoginDao extends BaseDao {
    @Override
    public int save(Object o) {
        return 0;
    }

    @Override
    public int updateById(Object o) {
        return 0;
    }

    @Override
    public int deleteById(int id) {
        return 0;
    }

    @Override
    public List findAll() {
        return null;
    }

    @Override
    public Object findById(int id) {
        return null;
    }

    @Override
    public List paging(int pageNumber) {
        return null;
    }

    public Login login(Login login){
        try {
            return this.template.queryForObject("select * from y_login where username = ? and password = ?" ,
                    new BeanPropertyRowMapper<>(Login.class),login.getUsername(),login.getPassword());
        }catch (Exception e){
            return null ;
        }
    }
}
